package com.wcity.manage.web.logistics;

import com.alibaba.fastjson.JSON;
import com.show.api.ShowApiRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 快递查询接口
 * Created by Zm on 2017/4/12.
 */
@Controller
public class LogisticsAct {

    @RequestMapping(value = "get_logistics", produces = "text/html; charset=UTF-8")
    @ResponseBody
    public Object getLogistics(String nu){

        String my_appId = "12810";
        String my_appSecret = "2318509fd44348d59ca08b97a9fb2a25";
        String res=new ShowApiRequest("http://route.showapi.com/64-19",my_appId,my_appSecret)
                .addTextPara("com","auto")
                .addTextPara("nu",nu)
                .post();
        System.out.println(JSON.toJSONString(res));

        return res;
    }

    public static void main(String[] args) {
        LogisticsAct logisticsAct = new LogisticsAct();
        logisticsAct.getLogistics("884524261949271369");
    }
}
